import org.apache.commons.lang3.StringUtils;

import com.alibaba.fastjson.JSONObject;
import com.aliyun.odps.udf.UDF;

public class SplitStringToArray extends UDF{

	public String evaluate(String ingredents,String ingredents2) {
		JSONObject obj = new JSONObject();
		if(StringUtils.isNotBlank(ingredents) && StringUtils.isNotBlank(ingredents2)) {
			String[] split1 = ingredents.split("、");
			obj.put("length1", split1.length);
			String[] split2 = ingredents2.split("、");
			obj.put("length2", split2.length);
			System.out.println(obj.toJSONString());
			return obj.toJSONString();
		}
		return obj.toJSONString();
	}
}
